package com.kabuda.zhugehot200;

/**
 * @author kabuda
 * @date 2025-03-16 21:01
 * @description
 */
public class t674_最长连续递增序列 {
    public static void main(String[] args) {
        System.out.println(findLengthOfLCIS(new int[]{1, 3, 5, 4, 7}));
    }

    /**
     * @param nums
     * @author kabuda
     * @date 2025/3/16 21:01
     * @description 贪心算法1
     */
    public  static  int findLengthOfLCIS(int[] nums) {
        if(nums.length==0){
            return 0;
        }
        int max = 1;
        int start = 0;
        for (int i = 1; i < nums.length; i++) {
            if (nums[i] <= nums[i - 1]) {
                start = i;
            }
            max = Math.max(max, i - start+1);
        }
        return max;
    }

}
